from selenium.webdriver.common.by import By
from day0409.Tools import Tools
from ddt import ddt,data,unpack

from day0409.Page.Page1 import Page1

path = r"C:\Users\HP\Desktop\login.xlsx"
sheetname = 'Sheet1'
dy = Tools(path, sheetname)
print(dy.getdata())

@ddt()
class Page2(Page1):

    gt_loc=(By.XPATH,'/html/body/div[4]/div/div[2]/div[2]/p/a[6]')
    def gt(self):
        self.click(self.gt_loc)

    jrdp_loc=(By.XPATH,'/html/body/div[6]/div/div[2]/div[2]/a')
    def jrdp(self):
        self.click(self.jrdp_loc)


    # 业务逻辑
    @unpack
    @data(*dy.getdata())
    def jiuxian_luoji_02(self,username,password):
        self.jiuxian_luoji_01(username=username,password=password)
        self.gt()
        self.new_window()
        self.jrdp()
        self.new_window()
        #向下滚动2000像素
        self.scrollTo_x(2000)



